/***************************************************************
*  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
*  All rights reserved.
*
*  This file is part of the GroupMe! Project. Source code of 
*  this project is closed and redistribution of this code is
*  prohibited. 
*  
*  Contact: http://www.groupme.net
*
*  This copyright notice MUST APPEAR in all copies of the file!
***************************************************************/
package net.groupme.search.strategy;

import java.util.List;

import net.groupme.model.Group;
import net.groupme.model.Resource;
import net.groupme.model.Tag;
import net.groupme.model.User;

/**
 * created on 19.12.2007
 * 
 * This interface defines a search strategy for searching within the
 * resource/group/tag-space of a certain user, e.g. searching only 
 * for the user's own groups
 * 
 * @author Fabian Abel, <a href="mailto:abel@l3s.de">abel@l3s.de</a>
 * @author last edited by: $Author: fabian $
 * 
 * @version $Revision: 1.2 $ $Date: 2008-11-01 20:18:05 $
 */
public interface UserSpecificSearchStrategy {

	/**
	 * Returns resources that are contained in groups the user owns. 
	 * @param user the owner 
	 * @param tag search string/tag
	 * @return resources that are contained in groups the user owns. 
	 */
	public abstract List<Resource> searchForOwnResources(User user, Tag tag);
	
	/**
	 * Returns resources that are contained in groups the user has subscribed to. 
	 * @param user the owner 
	 * @param tag search string/tag
	 * @return resources that are contained in groups the user has subscribed to. 
	 */
	public abstract List<Resource> searchForSubscribedResources(User user, Tag tag);
	
	/**
	 * Returns resources that are contained in groups the user owns or has subscribed to. 
	 * @param user the owner 
	 * @param tag search string/tag
	 * @return resources that are contained in groups the user owns or has subscribed to. 
	 */
	public abstract List<Resource> searchForOwnAndSubscribedResources(User user, Tag tag);
	
	/**
	 * Returns groups the user owns. 
	 * @param user the owner 
	 * @param tag search string/tag
	 * @return groups the user owns. 
	 */
	public abstract List<Group> searchForOwnGroups(User user, Tag tag);
	
	/**
	 * Returns groups the user has subscribed to. 
	 * @param user the owner 
	 * @param tag search string/tag
	 * @return groups the user has subscribed to. 
	 */
	public abstract List<Group> searchForSubscribedGroups(User user, Tag tag);
	
	/**
	 * Returns groups the user owns or has subscribed to. 
	 * @param user the owner 
	 * @param tag search string/tag
	 * @return groups the user owns or has subscribed to. 
	 */
	public abstract List<Group> searchForOwnAndSubscribedGroups(User user, Tag tag);
	
	/**
	 * Returns all resource/groups the user has annotated with the given tag. 
	 * @param user the user 
	 * @param tag the tag
	 * @return all resource/groups the user has annotated with the given tag. 
	 */
	public abstract List<Resource> searchForResourcesDirectlyTaggedByGivenUserWithGivenTag(User user, Tag tag);
	
	/**
	 * Returns all resource/groups the user has annotated with the given tag ad furthermore resources that are 
	 * contained in a user's group that is related to the given tag.
	 * @param user the user 
	 * @param tag the tag
	 * @return all resource/groups the user has annotated with the given tag. 
	 */
	public abstract List<Resource> searchForResourcesDirectlyTaggedOrContainedInRelatedGroupOfUser(User user, Tag tag);
}
